#ifndef X22_H
#define X22_H

#include "common.h"

template <AllegroVersion version>
struct x22
{
    uint32_t t;
    uint32_t k;
#if __cplusplus >= 202002L
    COND_FIELD(version >= A_172, uint32_t, un1);
#endif
    uint32_t un[8];

    uint32_t TAIL;
    operator x22<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus < 202002L
template <> struct x22<A_172>
{
    uint32_t t;
    uint32_t k;
    uint32_t un1;
    uint32_t un[8];

    uint32_t TAIL;
    operator x22<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x22<A_174> : x22<A_172> {};
#endif

#endif // X22_H
